package com.leo.util;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtils {
	/**
	 * 格式化时间
	 * @param date
	 * @return
	 */
	public static String dateToString(Date date){
		if(null==date)
			return null;
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		return sdf.format(date);
	}
	
	public static void main(String[] args) {
		System.out.println(dateToString(new Date()));
	}
}
